#ifndef UTILITY_H
#define UTILITY_H

#include <opencv2/imgproc/imgproc.hpp>
#include <opencv2/opencv.hpp>
#include <opencv2/objdetect/objdetect.hpp>

const int MAX_VECTOR_SIZE = 300;

class Utility
{
private:
    const int THRESHOLD = 160;
    const int STRUCT_ELEMENT_SIZE = 6;
    const int LINEAR_DURATION_SIZE = 250;
    double findMin(double number1, double number2, double number3);
 //   const int
public:
    Utility();
    cv::Mat convertToBinary(cv::Mat inputImage);
    std::vector<cv::Point> findContour(cv::Mat inputImage);
    double calEuclidianDistance(cv::Point refPoint, cv::Point chordPoint1, cv::Point chordPoint2);
    std::vector<double> obtainingLCS(std::vector<cv::Point> contour, int windowSize);
    std::vector<double> linearAligment(std::vector<double> originalVector);
    double findLinearBestMatching(std::vector<double> refVecto, std::vector<double> sampleVector);
    double findNonlinearBestMatching(std::vector<double> refVecto, std::vector<double> sampleVector);
    std::vector<double> normalizedAmplitude(std::vector<double> originalVector);
    std::vector<double> normalizedDuration(std::vector<double> originalVector, int newSize);

    //    double calDifferentMeasure();
};

#endif // UTILITY_H
